package com.realdtech.wechat.task.Service;

import com.realdtech.wechat.task.model.ChannelIn;

import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2017/10/28.
 */
public class ChannelInService {

    private static final ChannelIn dao=new ChannelIn().dao();
    /**
     * 保存渠道入驻信息
     * @param name
     **/

    public void add( String name,String tel,String company,String address,String product){

        ChannelIn channelIn=new ChannelIn();

        channelIn.setName(name);
        channelIn.setPhone(tel);
        channelIn.setCompany(company);
        channelIn.setAddress(address);
        channelIn.setProduct(product);
        channelIn.setDate(new Date());//创建时间
        channelIn.save();
    }
    /**
     * 查询channel_in数据库表
     * @return
     */
    public List<ChannelIn> findChannelIn(){

        return dao.find("SELECT * FROM channel_in  order by id desc");
    }
}
